package estoquefacil

class Funcionario{
	String login
	String senha
	String nome
	String CPF
	String telefone

	static belongsTo = [estoque:Estoque]
	
    static constraints = {
		nome(matches:"[^\\p{Punct}]+", size:4..30, blank:false)
		login(unique:true,nullable:true,  matches:"[\\p{Lower}\\p{Digit}]+", size:6..10)
		senha(size:6..12, blank:false,nullable:true)
		CPF(unique:true, size:11..11, matches:"[0-9]+")
		telefone(size:8..16)
    }
	
	String toString() {
		"${this.login} : ${this.nome}"
	}
}
